package com.snailxr.base.task.service;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.snailxr.base.task.dao.impl.DataDictionaryDaoImpl;
import com.snailxr.base.task.domain.DataDictionary;
@Service("dataDicService")
public class DataDicService {

	public final Logger log = Logger.getLogger(this.getClass());
	@Resource(name="dataDictionaryDaoImpl")
	DataDictionaryDaoImpl dataDictionaryDaoImpl;
	
	/**
	 * 获取字典列表
	 * @return
	 */
	public List<DataDictionary> getDicList(){
		List<DataDictionary> list = dataDictionaryDaoImpl.selectAll();
		return list;
	}
	
	/**
	 * 根据dicId获取一条数据
	 */
	
	public DataDictionary getJxOrg2ChnlByDicId(int dicId){
		return dataDictionaryDaoImpl.selectByDicId(dicId);
	}
	
	/**
	 * 插入一条数据
	 */
	public void addJxOrg2Chnl(DataDictionary ddic){
		dataDictionaryDaoImpl.insert(ddic);
	}
	
	/**
	 * 更新数据
	 */
	public void updateJxOrg2Chnl(DataDictionary ddic){
		dataDictionaryDaoImpl.update(ddic);
	}
	
	/**
	 * 删除一条数据
	 */
	public void deleteJxOrg2Chnl(DataDictionary ddic){
		int dicId = ddic.getDicId();
		dataDictionaryDaoImpl.delete(dicId);
	}
}
